/**
 * 
 */
package edu.gtcfla.km.security.service.impl;

import java.util.Set;

import javax.annotation.Resource;

import org.vsg.biz.BusinessOperationException;
import org.vsg.biz.account.Permission;
import org.vsg.biz.account.Url;
import org.vsg.biz.account.repositories.PermissionRepo;
import org.vsg.biz.account.repositories.UrlRepo;

import edu.gtcfla.km.security.service.UrlManagerService;

/**
 * @author Bill Vison
 *
 */
public class UrlManagerServiceI implements UrlManagerService{

	@Resource
	private UrlRepo<Url , String> urlRepo;
	
	@Resource
	private PermissionRepo<Permission , String> permissionRepo;
	
	public Url getUrlByCode(String code) throws BusinessOperationException {
		
		Url url = urlRepo.getByCode( code );
		
		return url;
	}
	
	
	public Set<Permission> findResourcesWithPermissionByRoles(Set<String> roleIds) throws BusinessOperationException {
		
		Set<Permission> assginedPerms = permissionRepo.findInUrl(roleIds);
		
		return assginedPerms;
	}	
	
}
